package gray.boolber.vk.web.api.items;

import org.json.JSONException;
import org.json.JSONObject;

public class Group {
	public String gid;
	public String name;
	public String isClosed;
	public String photo;
	public String photo_medium;
	public String photo_big;
	public String screen_name;
	public String type;
	public String isAdmin;
	public static Group parseGroup(JSONObject jsonObject) {
		Group gr=new Group();
		try {
			if(jsonObject.has("gid"))gr.gid=jsonObject.getString("gid");else gr.gid="";
			if(jsonObject.has("name"))gr.name=jsonObject.getString("name");else gr.name="";
			if(jsonObject.has("is_closed"))gr.isClosed=jsonObject.getString("is_closed");else gr.isClosed="";
			if(jsonObject.has("photo"))gr.photo=jsonObject.getString("photo");else gr.photo="";
			if(jsonObject.has("photo_medium"))gr.photo_medium=jsonObject.getString("photo_medium");else gr.photo_medium="";
			if(jsonObject.has("photo_big"))gr.photo_big=jsonObject.getString("photo_big");else gr.photo_big="";
			if(jsonObject.has("screen_name"))gr.screen_name=jsonObject.getString("screen_name");else gr.screen_name="";
			if(jsonObject.has("type"))gr.type=jsonObject.getString("type");else gr.type="";
			if(jsonObject.has("is_admin"))gr.isAdmin=jsonObject.getString("is_admin");else gr.isAdmin="";
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return gr;
	}

}
